package org.jeecg.modules.fund.util;

import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONArray;

/**
 * 获取股票代码
 * 沪深京 A 股股票代码和股票简称数据
 * [
 *     {
 *         "code": "000001",
 *         "name": "平安银行"
 *     },
 *     {
 *         "code": "000002",
 *         "name": "万  科Ａ"
 *     }]
 */
public class StockCodeUtil {
    public static JSONArray getHttpData(){
        try {
            String res = HttpUtil.get("http://127.0.0.1:9999/api/public/stock_info_a_code_name");
            return JSONArray.parseArray(res);
        }catch (Exception e){
            return null;
        }
    }
}
